import numpy as np
import cv2

#创建一个空白图像
img = np.zeros((512,512,3),np.uint8)

#蓝(255,0,0) 绿(0,255,0) 红(0,0,255)
cv2.line(img,(0,0),(511,511),(0,0,255),5)

cv2.imshow('line',img)
cv2.waitKey(0)
